package com.dba.example.guice.web.rest;

import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.Provider;

import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.datatype.hibernate4.Hibernate4Module;
import com.fasterxml.jackson.datatype.joda.JodaModule;
import com.fasterxml.jackson.jaxrs.xml.JacksonJaxbXMLProvider;

@Provider
@Consumes({MediaType.TEXT_XML, MediaType.APPLICATION_XML})
@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML})
public class ExampleJacksonJaxbXMLProvider extends JacksonJaxbXMLProvider {

	public ExampleJacksonJaxbXMLProvider() {
		super((XmlMapper) new XmlMapper().registerModule(new JodaModule()).registerModule(new Hibernate4Module()).configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false), DEFAULT_ANNOTATIONS);
	}

}
